package com.nb82.bean.im.pro;

import java.nio.charset.Charset;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class CodecFactory implements ProtocolCodecFactory{
  private static final Charset charset = Charset.forName("UTF-8");
  
  @Override
  public ProtocolEncoder getEncoder(IoSession session) throws Exception {
    return new Encode(charset);
  }

  @Override
  public ProtocolDecoder getDecoder(IoSession session) throws Exception {
    return new Decode(charset);
  }

}